/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GUIReport.java
 *
 * Created on Oct 30, 2011, 11:09:23 PM
 */
package gui;

import Config.Localization;
import bl.BLCustomer;
import da.DACustomer;
import da.DALoanContact;
import entities.Customer;
import entities.User;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import report.DialogReport;

/**
 *
 * @author Bich Tran Van
 */
public class GUIReport extends javax.swing.JPanel {

    /** Creates new form GUIReport */
    private BLCustomer blcustomer = null;
    private Customer customer = null;
    private ArrayList<Customer> customers = null;
    private User user = null;
    private DialogReport report;

    public GUIReport(User user) {
        this.user = user;
        blcustomer = new BLCustomer();
        customer = new Customer();
        customers = new ArrayList<Customer>();
        initComponents();
        loadInformation();
        refreshData();
    }

    public GUIReport() {
        initComponents();

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        lblTotalLoan = new javax.swing.JLabel();
        lblPayment = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lblAmount = new javax.swing.JLabel();
        lblTotalFine = new javax.swing.JLabel();
        lblInterest = new javax.swing.JLabel();
        lblCustomer = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        btnList = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbllist = new javax.swing.JTable();
        txtSearch = new javax.swing.JTextField();
        cboSelect = new javax.swing.JComboBox();
        btnSearch = new javax.swing.JButton();
        btnReportLoanType = new javax.swing.JButton();
        btnPaymentDueReport = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        btnAllReport = new javax.swing.JButton();

        setPreferredSize(new java.awt.Dimension(826, 550));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel1.setText("Total Loan");

        lblTotalLoan.setFont(new java.awt.Font("Times New Roman", 0, 18));
        lblTotalLoan.setForeground(new java.awt.Color(255, 0, 0));
        lblTotalLoan.setText("Total Loan");

        lblPayment.setFont(new java.awt.Font("Times New Roman", 0, 18));
        lblPayment.setForeground(new java.awt.Color(255, 0, 0));
        lblPayment.setText("Total Loan");

        jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel3.setText("Total Amount");

        jLabel6.setFont(new java.awt.Font("Times New Roman", 0, 18));

        jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel2.setText("Total Interest");

        jLabel4.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel4.setText("Total Fine");

        jLabel5.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel5.setText("Total Payment");

        lblAmount.setFont(new java.awt.Font("Times New Roman", 0, 18));
        lblAmount.setForeground(new java.awt.Color(255, 0, 0));
        lblAmount.setText("Total Loan");

        lblTotalFine.setFont(new java.awt.Font("Times New Roman", 0, 18));
        lblTotalFine.setForeground(new java.awt.Color(255, 0, 0));
        lblTotalFine.setText("Total Loan");

        lblInterest.setFont(new java.awt.Font("Times New Roman", 0, 18));
        lblInterest.setForeground(new java.awt.Color(255, 0, 0));
        lblInterest.setText("Total Loan");

        lblCustomer.setFont(new java.awt.Font("Times New Roman", 0, 18));
        lblCustomer.setForeground(new java.awt.Color(255, 0, 0));
        lblCustomer.setText("Total Loan");

        jLabel7.setFont(new java.awt.Font("Times New Roman", 0, 18));
        jLabel7.setText("Total Customer");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblTotalLoan, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblInterest, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(lblCustomer, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel3))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(lblTotalFine, javax.swing.GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)))
                .addGap(27, 27, 27)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblPayment, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(43, 43, 43))
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(0, 407, Short.MAX_VALUE)
                    .addComponent(jLabel6)
                    .addGap(0, 407, Short.MAX_VALUE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jLabel7)
                            .addComponent(lblCustomer)
                            .addComponent(lblAmount))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(lblTotalFine)
                            .addComponent(jLabel5)
                            .addComponent(lblPayment)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(lblTotalLoan))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(lblInterest))))
                .addGap(33, 33, 33))
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(0, 58, Short.MAX_VALUE)
                    .addComponent(jLabel6)
                    .addGap(0, 59, Short.MAX_VALUE)))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Customer Details", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 2, 18), new java.awt.Color(255, 0, 0))); // NOI18N

        btnList.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/list1.png"))); // NOI18N
        btnList.setText("List");
        btnList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnListActionPerformed(evt);
            }
        });

        tbllist.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tbllist.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                tbllistMousePressed(evt);
            }
        });
        jScrollPane1.setViewportView(tbllist);

        cboSelect.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "By Customer ID", "By Customer Name" }));
        cboSelect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboSelectActionPerformed(evt);
            }
        });

        btnSearch.setText("Search");
        btnSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cboSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnList))
                    .addComponent(jScrollPane1, 0, 0, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
                    .addComponent(cboSelect, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
                    .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
                    .addComponent(btnList, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        btnReportLoanType.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnReportLoanType.setText("Report By Loan Type");
        btnReportLoanType.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReportLoanTypeActionPerformed(evt);
            }
        });

        btnPaymentDueReport.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnPaymentDueReport.setText("Payment Due Report");
        btnPaymentDueReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPaymentDueReportActionPerformed(evt);
            }
        });

        jButton3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jButton3.setText("Fine Report");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        btnAllReport.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnAllReport.setText("All Customer's Report");
        btnAllReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAllReportActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(59, 59, 59)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(83, 83, 83)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnReportLoanType, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnPaymentDueReport, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAllReport, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(95, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addComponent(btnReportLoanType, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnPaymentDueReport, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnAllReport, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(47, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(5, 5, 5)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void loadInformation() {
        DALoanContact daloan = new DALoanContact();
        DACustomer daCus = new DACustomer();
        lblTotalLoan.setText(String.valueOf(daloan.getTotalLoan()));
        lblPayment.setText(String.valueOf(daloan.getTotalAmount()));
        lblTotalFine.setText(String.valueOf(daloan.getTotalFine()));
        lblInterest.setText(String.valueOf(daloan.getTotalInterest()));
        lblAmount.setText(String.valueOf(daloan.getTotalPayment()));
        lblCustomer.setText(String.valueOf(daCus.getTotalCustomer()));
        btnAllReport.setEnabled(false);
    }

    public void refreshData() {
        try {
            this.customers = blcustomer.getAll(user);
        } catch (Exception e) {
        }
        loadModel(customers);
    }

    public void loadModel(ArrayList<Customer> customers) {
        DefaultTableModel mode = new DefaultTableModel();
        mode.addColumn("CustomerID");
        mode.addColumn("Full Name");
        mode.setRowCount(customers.size());
        int i = 0;
        for (Customer n : customers) {
            mode.setValueAt(n.getCustomeId(), i, 0);
            mode.setValueAt(n.getFullname(), i, 1);
            i++;
        }
        btnAllReport.setEnabled(false);
        this.tbllist.setModel(mode);
    }
    private void btnReportLoanTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReportLoanTypeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnReportLoanTypeActionPerformed

    private void btnPaymentDueReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPaymentDueReportActionPerformed
        // TODO add your handling code here:
        report = new DialogReport(null, true, "./src/report/PaymentDueReport.jasper");
        report.setVisible(true);
    }//GEN-LAST:event_btnPaymentDueReportActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        report = new DialogReport(null, true, "./src/report/FineReport.jasper");
        report.setVisible(true);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void btnAllReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAllReportActionPerformed
        // TODO add your handling code here:
        report = new DialogReport(null, true, "./src/report/report2_1_1.jasper", customer.getCustomeId());
        report.setVisible(true);
        btnAllReport.setEnabled(false);
    }//GEN-LAST:event_btnAllReportActionPerformed

    private void cboSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboSelectActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cboSelectActionPerformed

    private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
        // TODO add your handling code here:
        int select = cboSelect.getSelectedIndex();
       String search = txtSearch.getText();
    try {
        switch (select) {
            case 0:
                int id = 0;
                try{
                    id = Integer.parseInt(search);
                }
                catch(Exception e){
                    JOptionPane.showMessageDialog(this, "ID must be number!");
                }
                this.customers = blcustomer.getByID(id,user);
                break;
            case 1:
                this.customers = blcustomer.getByName(search,user);
                break;
            default:
                break;
        }

        if(customers.size() == 0 ){
            JOptionPane.showMessageDialog(this, Localization.getMessage("NotFound"), "Information", JOptionPane.INFORMATION_MESSAGE);
        }
        loadModel(customers);
    } catch (Exception e) {
    }
    }//GEN-LAST:event_btnSearchActionPerformed

    private void tbllistMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbllistMousePressed
        // TODO add your handling code here:
        customer = customers.get(tbllist.getSelectedRow());
        btnAllReport.setEnabled(true);
    }//GEN-LAST:event_tbllistMousePressed

    private void btnListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnListActionPerformed
        // TODO add your handling code here:
        refreshData();
}//GEN-LAST:event_btnListActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAllReport;
    private javax.swing.JButton btnList;
    private javax.swing.JButton btnPaymentDueReport;
    private javax.swing.JButton btnReportLoanType;
    private javax.swing.JButton btnSearch;
    private javax.swing.JComboBox cboSelect;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblAmount;
    private javax.swing.JLabel lblCustomer;
    private javax.swing.JLabel lblInterest;
    private javax.swing.JLabel lblPayment;
    private javax.swing.JLabel lblTotalFine;
    private javax.swing.JLabel lblTotalLoan;
    private javax.swing.JTable tbllist;
    private javax.swing.JTextField txtSearch;
    // End of variables declaration//GEN-END:variables
}
